argss <- commandArgs(trailingOnly = TRUE)

print(argss)

package <- argss[1]
method = argss[2]

dest_dir <- paste(Sys.getenv("tools_path"), "R", sep="/")

# install_local <- function(package) {
	  # install.packages(package, dest_dir, repos=NULL)
# }
# install <- function(package) {
	  # install.packages(package, dest_dir, repos="http://cran.us.r-project.org", destdir=dest_dir)
# }
# install_bio <- function(package) {
	  # source("http://bioconductor.org/biocLite.R")
	  # biocLite(package)
# }
if (is.na(method)) {
	install.packages(package, dest_dir, repos="http://cran.us.r-project.org", destdir=dest_dir)
	  
}else if(method == "local") {
	  install.packages(package, dest_dir, repos=NULL)
}else if (method == "bioc") {
source("http://bioconductor.org/biocLite.R")
	  biocLite(package)
	  
}